﻿<%@ Page Title="" Language="C#" MasterPageFile="~/VSFuncionario.Master" AutoEventWireup="true" CodeBehind="AlunoConsulta.aspx.cs" Inherits="Presentation.AlunoConsulta" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table style="width:100%;">
        <tr>
            <td>
                <asp:HyperLink ID="HplArea" runat="server" NavigateUrl="~/AlunoCadastro.aspx">Novo Aluno</asp:HyperLink>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                    BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px" 
                    CellPadding="2" DataSourceID="SqlDataSource1" 
                    ForeColor="Black" GridLines="None" 
                     Width="290px" onrowdeleting="GridView1_RowDeleting">
                    <AlternatingRowStyle BackColor="PaleGoldenrod" />
                    <Columns>
                        
                        <asp:CommandField ShowDeleteButton="True" ShowSelectButton="True" />
                        
                        <asp:BoundField DataField="Nome" HeaderText="Nome" 
                            SortExpression="Nome" />
                        <asp:BoundField DataField="Email" HeaderText="Email" 
                            SortExpression="Email" />
                            <asp:BoundField DataField="Telefone" HeaderText="Telefone" 
                            SortExpression="Telefone" />
                        <asp:BoundField DataField="RA" HeaderText="RA" SortExpression="RA" />
                        <asp:CheckBoxField DataField="STAtivo" HeaderText="STAtivo" 
                            SortExpression="STAtivo" />
                        <asp:BoundField DataField="Nascimento" HeaderText="Nascimento" 
                            SortExpression="Nascimento" />
                        <asp:BoundField DataField="CPF" HeaderText="CPF" SortExpression="CPF" />
                        <asp:BoundField DataField="IDPessoa" HeaderText="IDPessoa" 
                            SortExpression="IDPessoa" />
                    </Columns>
                    <FooterStyle BackColor="Tan" />
                    <HeaderStyle BackColor="Tan" Font-Bold="True" />
                    <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" 
                        HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
                    <SortedAscendingCellStyle BackColor="#FAFAE7" />
                    <SortedAscendingHeaderStyle BackColor="#DAC09E" />
                    <SortedDescendingCellStyle BackColor="#E1DB9C" />
                    <SortedDescendingHeaderStyle BackColor="#C2A47B" />
                </asp:GridView>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:DBUCNConnectionString %>" 
                    DeleteCommand="DELETE FROM TBALUNO WHERE ID = @ID" 
                    SelectCommand="SELECT TBPessoa.Nome, TBPessoa.Email, TBPessoa.Telefone, TBAluno.RA, TBPessoa.STAtivo, TBPessoa.Nascimento, TBPessoa.CPF, TBAluno.IDPessoa FROM TBAluno INNER JOIN TBPessoa ON TBAluno.IDPessoa = TBPessoa.ID">
                    <DeleteParameters>
                        <asp:Parameter Name="ID" />
                    </DeleteParameters>
                </asp:SqlDataSource>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
    </table>
</asp:Content>